/*
 * Copyright (c) 2023 vitasystems GmbH
 *
 * This file is part of project EHRbase Migration Tool
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.ehrbase.migration.exporter.v0.jooq.pg.udt.records;

import org.ehrbase.migration.exporter.v0.jooq.pg.udt.CodePhrase;
import org.jooq.Field;
import org.jooq.Record2;
import org.jooq.Row2;
import org.jooq.impl.UDTRecordImpl;

/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({"all", "unchecked", "rawtypes"})
public class CodePhraseRecord extends UDTRecordImpl<CodePhraseRecord> implements Record2<String, String> {

    private static final long serialVersionUID = 1L;

    /**
     * Setter for <code>ehr.code_phrase.terminology_id_value</code>.
     */
    public void setTerminologyIdValue(String value) {
        set(0, value);
    }

    /**
     * Getter for <code>ehr.code_phrase.terminology_id_value</code>.
     */
    public String getTerminologyIdValue() {
        return (String) get(0);
    }

    /**
     * Setter for <code>ehr.code_phrase.code_string</code>.
     */
    public void setCodeString(String value) {
        set(1, value);
    }

    /**
     * Getter for <code>ehr.code_phrase.code_string</code>.
     */
    public String getCodeString() {
        return (String) get(1);
    }

    // -------------------------------------------------------------------------
    // Record2 type implementation
    // -------------------------------------------------------------------------

    @Override
    public Row2<String, String> fieldsRow() {
        return (Row2) super.fieldsRow();
    }

    @Override
    public Row2<String, String> valuesRow() {
        return (Row2) super.valuesRow();
    }

    @Override
    public Field<String> field1() {
        return CodePhrase.TERMINOLOGY_ID_VALUE;
    }

    @Override
    public Field<String> field2() {
        return CodePhrase.CODE_STRING;
    }

    @Override
    public String component1() {
        return getTerminologyIdValue();
    }

    @Override
    public String component2() {
        return getCodeString();
    }

    @Override
    public String value1() {
        return getTerminologyIdValue();
    }

    @Override
    public String value2() {
        return getCodeString();
    }

    @Override
    public CodePhraseRecord value1(String value) {
        setTerminologyIdValue(value);
        return this;
    }

    @Override
    public CodePhraseRecord value2(String value) {
        setCodeString(value);
        return this;
    }

    @Override
    public CodePhraseRecord values(String value1, String value2) {
        value1(value1);
        value2(value2);
        return this;
    }

    // -------------------------------------------------------------------------
    // Constructors
    // -------------------------------------------------------------------------

    /**
     * Create a detached CodePhraseRecord
     */
    public CodePhraseRecord() {
        super(CodePhrase.CODE_PHRASE);
    }

    /**
     * Create a detached, initialised CodePhraseRecord
     */
    public CodePhraseRecord(String terminologyIdValue, String codeString) {
        super(CodePhrase.CODE_PHRASE);

        setTerminologyIdValue(terminologyIdValue);
        setCodeString(codeString);
        resetChangedOnNotNull();
    }
}
